// 任务状态Arr
// export const taskStatusArr = [{text:'等待', value:'pending'},{text:'暂停', value:'stopped'},{text:'完成', value:'finished'},{text:'成功', value:'success'},{text:'失败', value:'failed'}]
export const taskStatusArr = [{text:'等待', value:'pending'},{text:'暂停', value:'stopped'},{text:'完成', value:'finished'}]

//任务状态Filter
export const taskStatusFilter = val => {
    let text = '';
    if(val == 'pending'){
      text = '等待'
    }else if(val == 'stopped'){
      text = '停止'
    } else if(val == 'finished'){
      text = '完成'
    } else if(val == 'success'){
      text = '成功'
    } else if(val == 'failed'){
      text = '失败'
    }
    return text;
}

//用户状态
export const userStatusArr = [{text:'启用',value:1},{text:'禁用',value:0}]

//用户状态Filter
export const userStatusFilter = val =>{
    let text = '';
    if(val == '0'){
      text = '禁用'
    }else if(val == '1'){
      text = '启用'
    }
    return text;
}

//用户组-添加组按钮-权限
export const addGroupBtnLevel = ['manager','admin','superadmin']

//任务-用户组下拉框-权限
export const userGroupSelectLevel = ['teamleader','admin','manager','superadmin']






















//时间过滤器
export const timeFilter = val => {
    if(!val){
        return ''
    }
    let date = new Date(val)
    let Y = date.getFullYear() + '-'
    let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
    let D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
    let h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
    let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'
    let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
    return Y + M + D + h + m + s
}